package com.weixing.mall.provider.controller.front;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.core.support.auth.MemAuth;
import com.weixing.mall.core.support.auth.MemInfo;
import com.weixing.mall.provider.api.service.SysConfigServiceFeign;
import com.weixing.mall.provider.service.IAgentAccountService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sunsw
 * @Title: ${FrontAgentController}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2019/11/115:40
 */
@RestController
@RequestMapping("frontAgent")
public class FrontAgentHomeController extends BaseController {
    @Autowired
    private IAgentAccountService agentAccountService;
    @Autowired
    private SysConfigServiceFeign sysConfigService;


    /**
     * 代理商首页内容返回结果
     * @return
     */
    @ApiOperation(value = "代理商首页内容返回结果")
    @PostMapping("index")
    public Result index(@MemInfo MemAuth auth){
        //Result<Integer> result = sysConfigService.getByCode(SysCfgCodeEnum.MEMBER_BIND_AGENT.getCode());

        return ResultUtil.success(agentAccountService.selectByAgentId(auth.getAbid()));
    }
}
